package cc.momas.v1;

/**
 * @author Sod-Momas
 * @since 2020/11/7
 */
public class Token {
    TokenType tokenType;
    DfaStates tokenState;
    StringBuilder tokenText;

    public Token() {
        this.tokenText = new StringBuilder();
    }

    public Token(TokenType tokenType, String tokenText) {
        this.tokenType = tokenType;
        this.tokenText = new StringBuilder(tokenText);
    }

    public TokenType getTokenType() {
        return tokenType;
    }

    public void setTokenType(TokenType tokenType) {
        this.tokenType = tokenType;
    }

    public String getTokenText() {
        return tokenText.toString();
    }

    public void setTokenText(String tokenText) {
        this.tokenText = new StringBuilder(tokenText);
    }

    public DfaStates getTokenState() {
        return tokenState;
    }

    public void setTokenState(DfaStates tokenState) {
        this.tokenState = tokenState;
    }

    @Override
    public String toString() {
        return "Token{" +
                "tokenType=" + tokenType +
                ", tokenState=" + tokenState +
                ", tokenText='" + tokenText + '\'' +
                '}';
    }
}
